package TestDemo.datbase;

import org.apache.commons.dbutils.QueryRunner;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * @author xxx
 * @date 2021/1/11 18:21
 * @description
 */
public class DataBaseDemo {
    public void dateTom(Connection connection, String a, double money) throws SQLException {
        QueryRunner queryRunner=new QueryRunner();

        String c="update account set money=money-? where name=?";

        queryRunner.update(connection,c,money,a);
    }

    public  void  dateJerry(Connection connection ,String b ,double money) throws SQLException {
        QueryRunner queryRunner=new QueryRunner();

        String d="update account set money=money+? where name=?";

        queryRunner.update(connection,d,money,b);
    }
}
